
function directedLineGraph = lineGraphDirector(L,varargin);

% A few variable initializations
[xmax ymax]=size(L);
directedLineGraph = zeros(xmax,ymax);
flag = 0;
edges = triu(L);

while (flag == 0),
    if (flag == 1),
        sprintf('Found valid directed L(G)')
    else
        directedLineGraph = L;
        for x = 1:xmax
            for y = 1:ymax
                if (edges(x,y) == 1),
                    if (randi(2) == 1),
                        directedLineGraph(x,y) = 0;
                    else
                        directedLineGraph(y,x) = 0;
                    end;
                end;
            end;
        end;
    end;
    
    % now to check
    flag = 1;
    test = sum(directedLineGraph);
    for x = 1:xmax
        if (test(x) == 0)
            flag = 0;
        end;
    end;
    test = sum(transpose(directedLineGraph));
    for x = 1:xmax
        if (test(x) == 0)
            flag = 0;
        end;
    end;
end;